function StringBuffer() {
    this.array = new Array();
};

StringBuffer.prototype.append = function(value) {
    this.array[this.array.length] = value;
    return this;
};

StringBuffer.prototype.toString = function() {
    var _string = this.array.join("");
    return _string;
};

// 截字符串
function wordwrap(text, max) {
    var lines = [];
    var i = 0;
    while(i < text.length) {
    	lines.push(text.substr(i, max));
    	i = i + max;
    };
    return lines;
};

// 判断是否为空 null undefined
function isEmpty(str) {
    if (typeof(str) != "undefined" && str != null && str != "") {
        return false;
    }
    return true;
};